<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>驳回</title>
    <jsp:include page="../../head.jsp"/>
</head>
<script type="text/javascript">
    var id = "${id}";
    var formSetting = {
        title: "绑定报关单号",
        module: "save",
        numCount: "1",
        columns: [{
            name: "id",
            label: "id",
            hidden: true
        }, {
            name: "sno",
            label: "报关单号"
        }],
        form: {
            'url': 'declaration-doBindingDeclarationNumber?id=' + id,
            'data': function () {
                if (id) {
                    var dataValue = "";
                    $.ajax({
                               url: "declaration-find?id=" + id,
                               async: false,
                               cache: false,
                               success: function (data) {
                                   dataValue = data;
                               }
                           });
                    return dataValue;
                } else {
                    return null;
                }
            },
            'ajaxForm': {
                success: function () {
                    window.parent.location.href =
                            "declaration-acceptedListForSupToValidate?declaraState=DS02&date="
                            + new Date();
                }
            }
// 			'afterAjaxSuccess' : function(responseText, statusText, xhr, $form) {
// 				var state = $.parseJSON(responseText.msg).state;
// 				if(state=="1") {
// 					try{jw.close();}catch(err){}
// 				}
// 			}
        },
        buttons: {
            custom: [
                {
                    id: "cancleBtn",
                    value: "取消",
                    click: function () {
                        jw.close();
                    }
                }
            ]
        }
    };
    $(document).ready(function () {
        $("#bindingDeclarationNumberForm").mrdForm(formSetting);
    });
</script>
<body>
<div style="width: 100%">
    <div id="bindingDeclarationNumberForm"></div>
</div>
</body>
</html>
